package com.sky.task;

import com.alibaba.fastjson.JSONObject;
import com.sky.server.WebSocketServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.UUID;

@Component
@Slf4j
public class OrderPaymentTask {
    @Autowired
    private WebSocketServer webSocketServer;

//    @Scheduled(cron = "0 0/1 * * * ?")
//    public void sendOrderMessage(){
//
////        log.info("send任务开始");
////        Map map = new HashMap();
////        map.put("type", 2);//消息类型，1表示来单提醒
////        map.put("orderId", 1); // 订单id
////        map.put("content", "订单号：" + UUID.randomUUID().toString().replaceAll("-",""));
////
////        webSocketServer.sendToAllClient(JSONObject.toJSONString(map));
//
//    }
}